package com.ruoyi.bom.controller;

import com.ruoyi.bom.domain.TqlBom;
import com.ruoyi.bom.service.ITqlBomService;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 成本卡制作Controller
 * 
 * @author ruoyi
 * @date 2023-12-31
 */
@RestController
@RequestMapping("/bom")
public class TqlBomController extends BaseController {

    @Autowired
    private ITqlBomService tqlBomService;

    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        List<TqlBom> list = tqlBomService.selectTqlBomById(id);
        return success(list);
    }

    @RequiresPermissions("bom:bom:remove")
    @Log(title = "成本卡制作", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(tqlBomService.deleteTqlBomByIds(ids));
    }
}
